import java.io.Serializable;
import java.util.Date;
import java.util.Calendar;

class Reminder implements Serializable {
	private boolean _isReminderOn;
	private Calendar _reminderTime;

	public Reminder(boolean reminder, Date reminderTime){
		this._isReminderOn = reminder;
		_reminderTime = Calendar.getInstance();
		if (reminderTime != null) {
			this._reminderTime.setTime(reminderTime);
		} else {
			_reminderTime.set(1950, 1, 1);
		}
	}
//@author A0105195J
	public int compareTo(Reminder j) {
		if (this.getReminderTime() == null && j.getReminderTime() == null) {
			return 0;
		}

		if (this.getReminderTime().before(j.getReminderTime())) {
			return -1;
		} else if (this.getReminderTime().after(j.getReminderTime())) {
			return 1;
		}
		return 0;
	}

	public String printReminderStatus() {
		String status;
		if (_isReminderOn){
			status = "Reminder: On";
		} else {
			status = "Reminder: Off";
		}
		return status;
	}

	public boolean getReminderStatus(){
		return _isReminderOn;
	}

	public void setReminderStatus(boolean reminder){
		this._isReminderOn = reminder;
	}

	public boolean isReminderValid()
	{
		Calendar cal = Calendar.getInstance();
		if(_reminderTime.getTime().after(cal.getTime())){
			return true;
		}
		return false;
	}

	public Date getReminderTime(){
		if(_reminderTime == null){
			return null;
		}
		return _reminderTime.getTime();
	}

	public void setReminderTime(Date rt){
		this._reminderTime.setTime(rt);
	}
}